

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>nrgpy.quality package &mdash; nrgpy 0.10.19 documentation</title>
  

  
  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/doctools.js"></script>
    
    <script type="text/javascript" src="_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="index.html" class="icon icon-home"> nrgpy
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <!-- Local TOC -->
              <div class="local-toc"><ul>
<li><a class="reference internal" href="#">nrgpy.quality package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-nrgpy.quality.quality">nrgpy.quality.quality module</a></li>
<li><a class="reference internal" href="#module-nrgpy.quality">Module contents</a></li>
</ul>
</li>
</ul>
</div>
            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">nrgpy</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>nrgpy.quality package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="_sources/nrgpy.quality.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="nrgpy-quality-package">
<h1>nrgpy.quality package<a class="headerlink" href="#nrgpy-quality-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-nrgpy.quality.quality">
<span id="nrgpy-quality-quality-module"></span><h2>nrgpy.quality.quality module<a class="headerlink" href="#module-nrgpy.quality.quality" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt id="nrgpy.quality.quality.check_for_missing_txt_files">
<code class="sig-prename descclassname">nrgpy.quality.quality.</code><code class="sig-name descname">check_for_missing_txt_files</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">txt_file_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nrgpy/quality/quality.html#check_for_missing_txt_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nrgpy.quality.quality.check_for_missing_txt_files" title="Permalink to this definition">¶</a></dt>
<dd><p>check list of files for missing file numbers</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>txt_file_names</strong><span class="classifier">list</span></dt><dd><p>list of SymphoniePRO text file exports</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>list</dt><dd><p>“missing” text file numbers</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="nrgpy.quality.quality.check_intervals">
<code class="sig-prename descclassname">nrgpy.quality.quality.</code><code class="sig-name descname">check_intervals</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">df</span></em>, <em class="sig-param"><span class="n">verbose</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">return_info</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">show_all_missing_timestamps</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">interval</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nrgpy/quality/quality.html#check_intervals"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nrgpy.quality.quality.check_intervals" title="Permalink to this definition">¶</a></dt>
<dd><p>checks for missing intervals in a pandas dataframe with a “Timestamp” column</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>df</strong><span class="classifier">object</span></dt><dd><p>the dataframe to be checked</p>
</dd>
<dt><strong>interval</strong><span class="classifier">int</span></dt><dd><p>[deprecated] the averaging interval in seconds</p>
</dd>
<dt><strong>verbose</strong><span class="classifier">bool</span></dt><dd><p>print results to terminal; False to skip</p>
</dd>
<dt><strong>return_info</strong><span class="classifier">bool</span></dt><dd><p>set to True to return dict with below values</p>
</dd>
<dt><strong>show_all_missing_timestamps</strong><span class="classifier">bool</span></dt><dd><p>set to True to show all missing timestamps in verbose option. otherwise, shows first and last 3.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>dict</dt><dd><dl class="simple">
<dt>actual_rows<span class="classifier">int</span></dt><dd><p>actual number of rows in data section of
export file (1 subtracted for column headers)</p>
</dd>
<dt>expected_rows<span class="classifier">int</span></dt><dd><p>expected number of rows (assumes 10 min. AVG),
converts result to whole integer</p>
</dd>
<dt>time_range<span class="classifier">str</span></dt><dd><p>range of time represented in export file</p>
</dd>
<dt>first_interval<span class="classifier">str</span></dt><dd><p>file starting timestamp</p>
</dd>
<dt>last_interval<span class="classifier">str</span></dt><dd><p>file ending timestamp</p>
</dd>
<dt>missing_timestamps<span class="classifier">list</span></dt><dd><p>a list of missing timestamps</p>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>ex. pass a reader.data dataframe for an interval check:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span> <span class="n">reader</span> <span class="o">=</span> <span class="n">nrgpy</span><span class="o">.</span><span class="n">sympro_txt_read</span><span class="p">()</span>
<span class="go">instance created, no filename specified</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">reader</span><span class="o">.</span><span class="n">concat_txt</span><span class="p">(</span><span class="n">txt_dir</span><span class="o">=</span><span class="s2">&quot;C:/data/sympro_data/000110/&quot;</span><span class="p">)</span>
<span class="gp">...</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">nrgpy</span><span class="o">.</span><span class="n">check_intervals</span><span class="p">(</span><span class="n">reader</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mi">600</span><span class="p">)</span>
<span class="go">Starting timestamp        : 2019-01-01 00:00:00</span>
<span class="go">Ending timestamp          : 2019-07-01 04:50:00</span>
<span class="go">Data set Duration         : 181 days, 4:50:00</span>
<span class="go">Expected rows in data set : 26093</span>
<span class="go">Actual rows in data set   : 26093</span>
<span class="go">Data set complete.</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt id="nrgpy.quality.quality.find_missing_intervals">
<code class="sig-prename descclassname">nrgpy.quality.quality.</code><code class="sig-name descname">find_missing_intervals</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">__df</span></em>, <em class="sig-param"><span class="n">interval</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nrgpy/quality/quality.html#find_missing_intervals"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nrgpy.quality.quality.find_missing_intervals" title="Permalink to this definition">¶</a></dt>
<dd><p>find gaps in data dataframe</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><dl class="simple">
<dt>list</dt><dd><p>a list of all missing intervals</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="nrgpy.quality.quality.select_interval_length">
<code class="sig-prename descclassname">nrgpy.quality.quality.</code><code class="sig-name descname">select_interval_length</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">df</span></em>, <em class="sig-param"><span class="n">seconds</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nrgpy/quality/quality.html#select_interval_length"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nrgpy.quality.quality.select_interval_length" title="Permalink to this definition">¶</a></dt>
<dd><p>returns the mode of the first 10 intervals of the data set</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>reader</strong><span class="classifier">nrgpy reader object</span></dt><dd><dl class="simple">
<dt>seconds<span class="classifier">bool</span></dt><dd><p>(True) set to False to get interval length in minutes</p>
</dd>
</dl>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>int</dt><dd></dd>
</dl>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="nrgpy.quality.quality.select_mode_from_list">
<code class="sig-prename descclassname">nrgpy.quality.quality.</code><code class="sig-name descname">select_mode_from_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lst</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nrgpy/quality/quality.html#select_mode_from_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nrgpy.quality.quality.select_mode_from_list" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-nrgpy.quality">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-nrgpy.quality" title="Permalink to this headline">¶</a></h2>
</div>
</div>


           </div>
           
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2020, NRG Systems, Technical Services.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>